#include ("/_includes/_layout.html")
#define css()
<link rel="stylesheet" type="text/css" href="#(webctx)/resources/css/product.css"/>
<link href="#(webctx)/resources/css/pretty.min.css" rel="stylesheet"/>	
<link href="#(webctx)/resources/css/component-chosen.min.css" rel="stylesheet"/>	
<style type="text/css">
label {
    display: inline-block;
    max-width: 100%;
    margin-bottom: 5px;
    font-weight: 1 !important;
}
</style>
#end

#define script()
<script type="text/javascript" charset="utf-8" src="#(webctx)/resources/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="#(webctx)/resources/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" src="#(webctx)/resources/js/chosen.jquery.js"></script>
<script type="text/javascript" src="#(webctx)/resources/js/product/product.edit.js"></script>
#end

#@layout("商品管理", "wxmall,点步科技", "Wxmall社区","wxmall") 
#define content()
<form id="inputForm" action="#(webctx)/product/save" method="post">
<input type="hidden" name="id" value="#(product.id??)" class="form-control" />
<input id="CSRF_TOKEN_HIDDEN_" name="csrf_token" type="hidden" value="#(CSRF_TOKEN)"/>
<div class="wrapper wrapper-content">
	    <div class="row">
		   <div class="col-sm-12">
				<div class="tabs-container" style="background:#e5e5e5 " >
			        <ul class="nav nav-tabs" id="topNavTabs">
			            <li class="active"><a href="javascript:void(0)" role="tab"  data-link="#js-step-2">1.编辑基本信息</a></li>
			            <li><a role="tab" href="javascript:void(0)" data-link="#js-step-3">2.编辑商品详情</a></li>
			        </ul>
			    </div>
				<div class="tab-content  ibox-content">
					<div id="js-step-2"  role="tabpanel" class="tab-pane active">
					     <div id="base-info-region" class="form-horizontal">
					         <div class="goods-info-group-inner">
					             <div class="info-group-title">基本信息</div>
								 <div class="info-group-content">
			                          <div class="form-group">
			                             <label class="col-md-2 control-label"><span class="requirespan">*</span>商品分类：</label>
			                             <div class="col-md-5">
				                              <select id="productCategoryId_sel" name="productCategoryId" class="form-control" style="width: 160px;">
				                              	 <option value="">请选择商品分类</option>
				                              #for(pcgory : productCategory)
								            	 #if(pcgory.id?? !=0)
										         <option value="#(pcgory.id??)" #if(pcgory.id?? == product.productCategoryId??) selected="selected" #end>#(pcgory.name??)</option>
										         #end
									          #end
									          </select>
									          <div id="error_productCategoryId">
									          <label class="control-label" for="productCategoryId" style="color:red;"></label>
									          </div>
									          <div style="float: left;"><a class="new-window" href="#(webctx)/category/add">新建分类</a></div>
				                         </div>
			                          </div>
			                          
			                          <div class="form-group">
			                              <label class="col-md-2 control-label"><span class="requirespan">*</span>商品名：</label>
			                              <div class="col-md-4" id="error_product_name">
							                <input type="text" id="product_name"  name="name" value="#(product.name??)"  class="form-control"/>
							                <label class="control-label" for="product_name" style="color:red;"></label>
								          </div>
			                          </div>
			                          
			                          <!-- <div class="form-group">
								          <label class="col-md-2 control-label">售后展示：<span style="color: red;"><em>*</em></span></label>
								          <div class="col-md-5" id="error_pay_secret_key" style="padding-top: 6px;">
												<input type="checkbox" id="showDeliveryTime" type="checkbox" checked="checked" /><label for="showDeliveryTime">&nbsp;全场48小时发货&nbsp;&nbsp;&nbsp;&nbsp;</label>
												<input type="checkbox" id="showCompensate" checked="checked"  /><label for="showCompensate">&nbsp;假一赔十&nbsp;&nbsp;&nbsp;&nbsp;</label>
												<input type="checkbox" id="showSafeguard"  checked="checked" /><label for="showSafeguard">&nbsp;七天退货&nbsp;&nbsp;&nbsp;&nbsp;</label>
								          </div>
								      </div> -->
			                          
			                          <div class="form-group">
			                              <label class="col-md-2 control-label">分享描述：</label>
			                              <div class="col-md-4" id="error_share_desc">
							                <input type="text" id="share_desc" name="share_desc" value="#(product.share_desc??)" class="form-control"/>
							                <label class="control-label" for="share_desc"></label>
								          </div>
			                          </div>
			                          
			                           <div class="form-group">
			                             <label class="col-md-2 control-label"><span class="requirespan">*</span>商品列表图：</label>
			                             <div class="col-md-5">
			                                 <div class="main-image-div">
			                                    #if(product != null)
			                                      <img class="image-preview" src="#(img_domain)#(product.image)" >
		                                          <a class="close-modal small hide" href="javascript:void(0);" onclick="deleteMainImg();">×</a>
		                                          <input name="image" value="#(product.image)" type="hidden">
			                                    #else 
									                <a class="main-image-add" onclick="addPicture(true);" href="javascript:;" >+加图</a>
									            #end 
									           </div>
									           <p class="size-remark">建议尺寸：480*480像素 </p>
							                  <label id="only_error_msg" style="color:red;"></label>
								          </div>
			                           </div>
			                           
			                           <div class="form-group">
			                             <label class="col-md-2 control-label"><span class="requirespan">*</span>商品轮播图：</label>
			                             <div class="col-md-10">
			                                 <ul class="app-image-list" id="product-image-list">
								                #if(productAllResultDto !=null)
													#for(images: productAllResultDto.imageList)
					                                    <li class="sort"><img src="#(images.imgPath)"  class="js-img-preview"/>
					                                    <input name="imgList" value="#(images.imgUrl)" type="hidden"  class="js-img-preview"/>
					                                    <a class="js-delete-picture close-modal small hide" onclick="deleteImg(this);">×</a>
					                                    </li>
				                                    #end					                
								                #end
								                 <li><a href="javascript:void(0);" onclick="addImagList(false);" class="add-goods">+加图</a></li>
							                 </ul>
							                 <p class="size-remark">建议尺寸：640*480像素 </p>
							                 <label id="image_error_msg" style="color:red;"></label>
								          </div>
			                           </div> 
				                       
				                 </div>
					         </div>
					         
					         <div class="goods-info-group-inner">
					             <input type="hidden" id="allStocks"  name="stocks" value=""/>
					             <div class="info-group-title">库存/规格</div>
								 <div class="info-group-content">
		                            <div class="form-group">
							            <label class="col-md-2 control-label"><span class="requirespan">*</span>规格设置：</label>
							            <div class="col-md-4">
							                <div class="sign_list">
								                <label class="radio-inline" for="spec_radio1">
			                                     	<input id="spec_radio1" name="is_unified_spec" class="frm_radio" value="true" onclick="changeType();" #if(product==null || (product!=null && product.is_unified_spec)) checked="checked" #end type="radio" style="position: relative;top: 2px"/>
			                                      	<span>统一规格</span>
			                         	        </label>
			                         	        <label class="radio-inline" for="spec_radio2">
			                                     	<input id="spec_radio2" name="is_unified_spec" class="frm_radio" value="false" onclick="changeType();" #if(product!=null && !product.is_unified_spec) checked="checked" #end type="radio" style="position: relative;top: 2px"/>
			                                      	<span>多规格</span>
			                         	        </label>
		                         	        </div>
		                         	     </div>
		                         	 </div>
		                         	 
		                         	 <div id="unified">
				                          <div class="form-group">
				                              <label class="col-md-2 control-label"><span class="requirespan">*</span>价格：</label>
				                              <div class="col-md-4" id="error_product_price">
												  <input type="text" id="product_price" name="price" value="#(product.price??)" style="width: 120px;" class="form-control" onkeyup="checkNum(this);"/>
												  <label class="control-label" for="product_price"></label>
											  </div>
				                          </div>
				                      
				                          <div class="form-group">
				                              <label class="col-md-2 control-label"><span class="requirespan">*</span>商品库存：</label>
				                              <div class="col-md-4" id="error_allStock">
									              <input type="text" id="allStock" name="stock" value="#(product.stock??)" style="width: 120px;" class="form-control" onkeyup="value=value.replace(/[^\d]/g,'')"/>
									              <label class="control-label" for="allStock"></label>
									          </div>
				                          </div>
				                    </div>
		                         	 
		                          <div class="form-group" id="allSpec" >
		                             <label class="col-md-2 control-label"><span class="requirespan">*</span>商品规格：</label>
		                             <div class="col-md-10">
		                             <table class="table table-striped" style="font-size: 12px;">
		                              <tr>
		                              <td width="20%">选择规格</td>
						                 <td>
							               <div id="specificationSelect" class="specificationSelect">
												<ul id="specificationUl">
												#if(specificationResultDto !=null)
		                                           #for(resultDto: specificationResultDto)
		                                           	   #if(resultDto.specification !=null)
		                                           	   #set(specification = resultDto.specification)
		                                           	   #set(has = false)
		                                           	   #if(productAllResultDto != null && productAllResultDto.specifications !=null)
		                                           	      #for(prodSpec : productAllResultDto.specifications)
		                                           	      	 #if(prodSpec.id == specification.id)
		                                           	      		#set(has = true)
		                                           	      		#break
		                                           	      	 #end
		                                           	      #end
		                                           	   #end
		                                           	   <li><label><input type="checkbox" name="specificationIds" value="#(specification.id)" #if(has !=null && has == true) checked="checked" #end/>#(specification.name)</label></li>
		                                           	   #end
			                                       #end
												#end
												<li><a href="javascript:;" onclick="addSpecification();" class="js-add-sku-atom add-sku" style="display: inline;">+添加规格</a></li>	
												</ul>																								    
							               </div>
							               </td>
							               </tr>
							               <tr>
							               <td>选择规格值
							               <label id="specificationValue_error_msg" style="color:red;"></label>
							               </td>
												<td>
													#if(product !=null)
													<table id="specificationProductTable" style="font-size: 12px;" class="table table-striped table-bordered">
													<tbody id="specificationProductTbody">
													#if(specificationResultDto !=null)
													#for(resultDto: specificationResultDto)
														#if(resultDto.specification !=null)
		                                           	    #set(specification = resultDto.specification)
		                                           	    #set(has = false)
		                                           	    #if(productAllResultDto != null && productAllResultDto.specifications !=null)
		                                           	      #for(prodSpec : productAllResultDto.specifications)
		                                           	      	 #if(prodSpec.id == specification.id)
		                                           	      		#set(has = true)
		                                           	      		#break
		                                           	      	 #end
		                                           	      #end
		                                           	    #end
													 	<tr class="specification_#(specification.id) #if(has!=null && !has) hidden #end">
														<td><ul class="specificationSelect #if(has!=null && has) Father_Title #end" id="Title_#(specification.id)"> <li>#(specification.name)</li></ul></td>
													  	<td>
								                        <ul class="Title_#(specification.id) Father_Item Item specificationSelect" id="Item_#(specification.id)">
								                        #for(specificationValue: resultDto.specificationValues)
								                        	#if(productAllResultDto != null && productAllResultDto.specificationValues !=null)
								                        	#set(has_v=false)
			                                           	      #for(prodSpecValue : productAllResultDto.specificationValues)
			                                           	      	 #if(prodSpecValue.id == specificationValue.id)
			                                           	      		#set(has_v = true)
			                                           	      		#break
			                                           	      	 #end
			                                           	      #end
			                                           	    #end
															<li class="li_width"><label>
															<input type="checkbox" name="specificationValues" value="#(specificationValue.id)_#(specification.id)" data-value="#(specificationValue.id)" data-val="#(specificationValue.name)" #if(has_v!=null && has_v==true) checked="checked" #end/>#(specificationValue.name)
															</label>								
															</li>
													    #end
													    </ul>
													   	</td>
														</tr>
													   	#end
								                   	#end
													#end
													</tbody>
													</table>
													#else
													<table id="specificationProductTable" style="font-size: 12px;" class="table table-striped table-bordered">
													<tbody id="specificationProductTbody">
													#if (specificationResultDto!=null)
														#for (resultDto : specificationResultDto)
															#set(specification = resultDto.specification) 
														<tr class="specification_#(specification.id) hidden">
															<td>	
															<ul class="specificationSelect" id="Title_#(specification.id)"> <li>#(specification.name)</li></ul>
														  	</td>
														  <td>
									                        <ul class="Title_#(specification.id) Father_Item Item specificationSelect" id="Item_#(specification.id)">
									                        #for(specificationValue : resultDto.specificationValues)
																<li class="li_width">
																<label>
																<input type="checkbox" name="specificationValues" value="#(specificationValue.id)_#(specification.id)" data-value="#(specificationValue.id)" data-val="#(specificationValue.name)"/>#(specificationValue.name)														
																</label>
																</li>
														    #end
														    </ul>
														   </td>
														</tr>
									                    #end
								                    #end
								                    </tbody>
													</table>
													#end
												</td>
											</tr>
											<tr>
											  <td>规格明细</td>
											  <td id="createTable"></td>
											</tr>
							              </table>
							          </div>
		                          </div>
				                 </div>
					         </div>
					         <div class="goods-info-group-inner">
					             <div class="info-group-title">物流/其它</div>
								 <div class="info-group-content">
								 		<div class="form-group"  id="cityDiv">
				                             <label class="col-md-2 control-label"><span class="requirespan">*</span>是否同城配送：</label>
				                              <div class="col-md-8" style="padding-top: 4px;">
					                              <label>
														<input type="checkbox" onclick="city()" id="isCityDis" name="isCityDis" value="true" #if(product?? && product.isCityDis??) checked="checked" #end style="position: relative;top: 2px"/>&nbsp;
														<input type="hidden" name="_isCityDis" value="false" />
												  </label>
				                              </div>
					                     </div>
								 		<div class="form-group"  id="pickUpDiv">
				                             <label class="col-md-2 control-label"><span class="requirespan">*</span>是否到店自提：</label>
				                              <div class="col-md-8" style="padding-top: 4px;">
					                              <label>
														<input type="checkbox" onclick="pickUp()" id="isPickUp" name="isPickUp" value="true" #if(product?? && product.isPickUp??) checked="checked" #end style="position: relative;top: 2px"/>&nbsp;
														<input type="hidden" name="_isPickUp" value="false" />
												  </label>
				                              </div>
					                     </div>
										 <div class="form-group" id="virtualDiv">
				                             <label class="col-md-2 control-label"><span class="requirespan">*</span>是否虚拟商品：</label>
				                              <div class="col-md-2" style="padding-top: 4px;">
				                              <label>
													<input type="checkbox" onclick="virtualGoods()" id="isVirtualGoods" name="isVirtualGoods" value="true" #if(product?? && product.isVirtualGoods??) checked="checked" #end style="position: relative;top: 2px"/>&nbsp;
													<input type="hidden" name="_isVirtualGoods" value="false" />
											  </label>
				                              </div>
					                     </div>
				                        <div class="form-group" id="deliveryOne" style="display: block;">
				                             <label class="col-md-2 control-label"><span class="requirespan">*</span>运费设置：</label>
				                              <div class="col-md-4">
				                              <label>
													<input id="js-unified-postage" name="delivery_type" value="0" #if(product ==null || (product!=null && product.delivery_type==0)) checked="checked" #end type="radio" onclick="changeDelivertyType();" style="position: relative;top: 2px">
													统一邮费 
									               <div class="input-group" style="margin-bottom: 0px;vertical-align: middle;display: inline-block;">
													  <input type="text" name="delivery_fees"  value="#(product.delivery_fees??0)" class="form-control" onkeyup="value=value.replace(/[^\d]/g,'')"/>
													  <label class="delivery_fees_error_msg" style="color:red;"></label>
												   </div>
									          </label>
									          </div>
				                          </div>
				                          <div class="form-group" id="deliveryTwo" style="display: block;">
				                             <label class="col-md-2 control-label"></label>
				                              <div class="col-md-6">
					                              <label>
														<input id="js-unified-postage" name="delivery_type" value="1" #if(product!=null && product.delivery_type==1) checked="checked" #end type="radio" onclick="changeDelivertyType();" style="position: relative;top: 2px">
														运费模板
														<div class="delivery-template" style="display: inline-block;vertical-align: middle;">
														    <select class="form-control" name="delivery_template_id" id="delivery_memo">
														    	<option value="">请选择运费模板</option>
														    </select>
														    <input type="hidden" value="#(productDeliveryTemplate.id??)" id="delivery_memo_input"/>
													   </div>
										               <div class="help-inline" style=" display: inline-block;padding-left: 5px;vertical-align: middle;">
											               <a class="js-refresh-delivery" href="javascript:;">刷新</a>
											               <span class="c-gray">|</span>
						                                   <a class="new-window" href="#(webctx)/delivery/add" target="_blank">新建</a>
										               </div>
										          </label>
										          <label class="delivery_template_error_msg" style="color:red;"></label>
									          </div>
				                          </div>
				                          
				                          <div class="form-group" id="weight_memo" style="display: none;">
				                              <div class="form-group">
				                                <label class="col-md-2 control-label"></label>
				                                <div class="col-md-6" style="color: #999999;">
				                                  <label> 当前运费模板，按物流重量（含包装）计费</label>
				                                </div>
				                              </div>
				                              <label class="col-md-2 control-label"></label>
				                              <div class="col-md-10">
				                                  <label class="control-label"><span class="requirespan">*</span>物流重量：</label>
				                                  <div class="input-group" id="unified_weight" style="margin-bottom: 0px;vertical-align: middle;display: inline-block;hidden">
													  <input type="text" id="delivery_weight" name="delivery_weight"  value="#(product.delivery_weight??)" class="control-inline" max-length="10" style="width:80px;"  onkeyup="value=value.replace(/[^\d.]/g,'')"/> 千克
													  <label class="delivery_weight_error_msg" style="color:red;"></label>
												  </div>
												  <div class="input-group" id="disunified_weight" style="margin-bottom: 0px;vertical-align: middle;display: inline-block;hidden">
													  <div id="createdWeight"></div>
												  </div>
				                              </div>
				                          </div>
				                          
				                        <div class="form-group">
				                             <label class="col-md-2 control-label"><span class="requirespan">*</span>上架：</label>
				                              <div class="col-md-2" style="position: relative;top: 4px">
				                              <label>
													<input type="checkbox" name="isMarketable" value="true" #if(product==null || (product?? && product.isMarketable)) checked="checked" #end style="position: relative;top: 2px"/>&nbsp;立即上架
													<input type="hidden" name="_isMarketable" value="false" />
											  </label>
				                              </div>
			                          	</div>
			                          	<!-- <div class="form-group">
				                             <label class="col-md-2 control-label"><span class="requirespan">*</span>商品类型：</label>
				                              <div class="col-md-4 " style="padding-top: 4px;">
					                              <label style="display: block;">
														<input type="radio" class="disabled-input" name="product_type" value="1" #if(product?? && product.productType?? && product.productType == 1) checked="checked" #end style="position: relative;top: 2px"/>&nbsp;正常售卖商品
												  </label>
					                              <label style="display: block;">
														<input type="radio" class="disabled-input" name="product_type" value="2" #if(product?? && product.productType?? && product.productType == 2) checked="checked" #end style="position: relative;top: 2px"/>&nbsp;任务宝商品(仅限完成任务者购买)
												  </label>
					                              <label style="display: block;">
														<input type="radio" class="disabled-input" name="product_type" value="3" #if(product?? && product.productType?? && product.productType == 3) checked="checked" #end style="position: relative;top: 2px"/>&nbsp;积分宝商品(仅限使用积分兑换成功者购买)
												  </label>
					                              <label style="display: block;">
														<input type="radio" class="disabled-input" name="product_type" value="4" #if(product?? && product.productType?? && product.productType == 4) checked="checked" #end style="position: relative;top: 2px"/>&nbsp;助力免单商品 (仅限完成助力活动者购买)
												  </label>
					                              <label style="display: block;">
														<input type="radio" class="disabled-input" name="product_type" value="5" #if(product?? && product.productType?? && product.productType == 5) checked="checked" #end style="position: relative;top: 2px"/>&nbsp;签到商品 (仅限签到活动者购买)
												  </label>
												  <label style="display: block;">
												  		<span style="color: red">注意：商品类型一经保存，不允许二次修改</span>
												  </label>
				                              </div>
			                          	</div> -->
			                          	<div class="form-group">
				                             <label class="col-md-2 control-label"><span class="requirespan">*</span>是否限购：</label>
				                              <div class="col-md-4"  style="padding-top: 4px;">
				                              <label>
													<input type="checkbox" name="isPurchaseLimitation" value="true" #if(product?? && product.isPurchaseLimitation??) checked="checked" #end style="position: relative;top: 2px"/>&nbsp;限制每人可以购买数量
													<input type="hidden" name="_isPurchaseLimitation" value="false" />
											  </label>
				                              </div>
			                          	</div>
				                          <div class="form-group" >
				                             <label class="col-md-2 control-label"></label>
				                              <div class="col-md-6">
					                              <label>
														<div class="delivery-template" style="vertical-align: middle;position: relative;bottom: 11px;">
															每个买家账号累计限购&nbsp;
														<div class="input-group" style="margin-bottom: 0px;vertical-align: middle;display: inline-block;width: 50px;">
														  <input type="text" name="purchaseCount"  value="#(product.purchaseCount??0)" class="form-control" onkeyup="value=value.replace(/[^\d]/g,'')"/>
														  <label class="delivery_fees_error_msg" style="color:red;"></label>
													   </div>&nbsp;件
													   </div>
										          </label>
										          <label class="delivery_template_error_msg" style="color:red;"></label>
									          </div>
				                          </div>
				                  </div>
				              </div>
					     </div>
					   <div class="action-bar">
					      <button type="button"  onclick="goStepThree();" class="btn btn-primary">下一步</button>
					      <a href="#(webctx)/product" class="btn btn-default">取   消</a>
					   </div>
					</div>
					
					<div id="js-step-3"  role="tabpanel" class="tab-pane">
					    <div id="step-content-region" style="padding-top: 20px;">
							<div class="app-sidebar-inner js-sidebar-region" style="width: 396px; z-index: 1;padding-top: 20px;">    
							   <script type="text/plain" id="editor" name="introduction"></script>
							</div>		 
					    </div>
					     
					    <div class="action-bar">
					      	<button type="button" onclick="backStepTwo();" class="btn btn-default">上一步</button>
					       	<button type="button" onclick="saveProductForm();" class="btn btn-primary">保存商品</button>
					   	</div>
					</div>
				</div>		
	       </div>
		</div>	
</div>
</form>
<script type="text/template" id="specification_li_tpl">
<li><label><input type="checkbox" name="specificationIds" value="{id}"/>{name}</label></li>
</script>
<script type="text/template" id="specificationValue_tr_tpl">
<tr class="specification_{id} hidden">
	<td><ul class="specificationSelect" id="Title_{id}"> <li>{name}</li></ul></td>
	<td><ul class="Title_{id} Father_Item Item specificationSelect" id="Item_{id}"></ul></td>
</tr>
</script>

<script type="text/template" id="specificationValue_li_tpl">
<li class="li_width">
	<label><input type="checkbox" name="specificationValues" value="{id}_{specification_id}" data-value="{id}" data-val="{name}"/>{name}</label>
</li>
</script>
<script type="text/template" id="ul_li_tpl">
    <li data-file="{filePath}" data-fileUrl="{fileName}">
       <img alt="" src="{filePath}">
       <div class="image-title">{fileName}</div>
    </li>
</script>
#end
<script type="text/javascript">
var listImg="";	
var listImgUrl="";
var listUpload="";
var g_spec_type="";
var catagory="#(product.product_category_id??)";
var selectImg = new Array();
var productId = '#(product.id??)';
var curActive="#js-step-2";

function getPrice(){
	#if (productAllResultDto!=null)
		#for(stock : productAllResultDto.stocks) 
	  	$("#priceId"+"#(for.index)").val(#(stock.price)); 
	  	$("#stockId"+"#(for.index)").val(#(stock.stock));
	  	$("#weightId"+"#(for.index)").val(#(stock.weight));
	  	#end
	#end
}
	
var ue = UE.getEditor('editor',{
	toolbars: [
				["bold", "italic", "underline", "strikethrough", "forecolor", "backcolor", "justifyleft", "justifycenter", "justifyright", "|", "insertunorderedlist", "insertorderedlist", "blockquote",
				"simpleupload", "insertimage", "insertvideo", "link", "removeformat", "|", "rowspacingtop", "rowspacingbottom", "lineheight", "paragraph", "fontsize",
				"inserttable", "deletetable", "insertparagraphbeforetable", "insertrow", "deleterow", "insertcol", "deletecol", "mergecells", "mergeright", "mergedown", "splittocells", "splittorows", "splittocols"]
			],
			autoClearinitialContent: false,
			enableAutoSave: false,
			autoFloatEnabled: !0,
			wordCount: !1,
			elementPathEnabled: !1,
			initialContent:'#(product.introduction??)',
  		/* 	initialFrameWidth: 396, */
			initialFrameHeight: 350, 
			focus: !1,
			pasteplain: !1
});

$(function(){
	#if(product?? && product.isVirtualGoods??)
	virtualGoods();
	#end
	#if(product?? && product.isPickUp??)
	pickUp();
	#end
	#if(product?? && product.isCityDis??)
	city();
	#end
})

function virtualGoods(){
	var check = $("#isVirtualGoods").prop("checked");
	showOrHideDelivery();
}

function pickUp(){
	var check = $("#isPickUp").prop("checked");
	if(check){
		$("#isCityDis").attr("checked", false);
	}
	showOrHideDelivery();
}

function city(){
	var check = $("#isCityDis").prop("checked");
	if(check){
		$("#isPickUp").attr("checked", false);
	}
	showOrHideDelivery();
}

function showOrHideDelivery(){
	if($('#isCityDis').is(':checked') || $('#isPickUp').is(':checked') || $('#isVirtualGoods').is(':checked')){
		$("#deliveryOne").attr("style","display: none;");
		$("#deliveryTwo").attr("style","display: none;")
	}else{
		$("#deliveryOne").attr("style","display: block;")
		$("#deliveryTwo").attr("style","display: block;")
	}
}
</script>